<?php

class Db_Tables2_BOwner
{
	function __construct() {
		$this->dealers_db = Zend_Registry::get("dealers_db");
	}
	
	function GetOwners()
	{
		$result = array();
		
		$select = $this->dealers_db->select();
		$select->from("b_owner", array("owner_id", "owner_name"));
		$select->where("status = ?", 1);
		$data = $this->dealers_db->fetchAll($select);
		
		if(!empty($data))
		{
			foreach($data as $d)
			{
				$result[$d['owner_id']] = $d['owner_name'];
			}
		}
		
		return $result;
	}
	
	function FetchOwnerDetails($owner_id)
	{
		$result = array();
		
		if($owner_id)
		{
			$select = $this->dealers_db->select();
			$select->from("b_owner", "*");
			$select->where("owner_id = ?", $owner_id);
			$result = $this->dealers_db->fetchRow($select);
		}
		
		return $result;
	}
}